<template>
	<view class="box">
		<view class="hearder">
			<view class="left" @click="goBack">
				<image src="https://s1.ax1x.com/2022/11/26/ztJzTO.png" mode="widthFix"></image>
				返回
			</view>
			<view class="center">我的房屋</view>
			<view class="right" @click="go">添加</view>
		</view>
		<view class="house" v-for="item in list" :key="item.id">
			<view class="address">
				<view class="">{{item.building}}</view>
				<view class="mode">{{item.stateName}}</view>
			</view>
			<view class="detail">
				<view class="row">
					<text>房号</text>
					<text>{{item.houseno}}</text>
				</view>
				<view class="row">
					<text>姓名</text>
					<text>{{item.name}}</text>
				</view>
				<view class="row">
					<text>电话</text>
					<text>{{item.mobile}}</text>
				</view>
				<view class="row">
					<text>住户类型</text>
					<text>{{item.usertypeName}}</text>
				</view>
			</view>
			<view class="time">
				<view class="">{{item.usernative}}</view>
				<button type="default">删除</button>
			</view>
		</view>
	</view>
</template>

<script>
	import {houseCheck} from '../../utils/api.js'
	export default{
		data(){
			return{
				list:[]
			}
		},
		onLoad() {
			this.getHouseCheck()
		},
		methods:{
			async getHouseCheck(){
				let res=await houseCheck()
				console.log(res);
				if(res.errCode==10000){
					this.list = res.data.list
				}
			},
			// 返回
			   goBack(){
			    uni.switchTab({
					url:'../mine'
			    })
			   },
			go(){
				uni.navigateTo({
					url:'../houuseList/houseList'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	page{
		width: 100%;
		height: 100%;
		background-color: #f0f0f0;
		font-size: 24rpx;
	}
	.box{
		width: 100%;
		height: 100%;
		.hearder{
			width: 100%;
			height: 135rpx;
			background-color: #fff;
			display: flex;
			// align-items: center;
			justify-content: space-between;
			padding: 0 10rpx;
			box-sizing: border-box;
			font-size: 30rpx;
			line-height: 135rpx;
			.left image{	
				width: 16rpx !important;
				height: 23rpx !important;
				// vertical-align: bottom;
				
				margin-right: 10rpx;
			}
			
		}
		.house{
			width: 730rpx;
			height: 475rpx;
			margin: 0 auto;
			margin-top: 20rpx;
			background-color: #fff;
			padding: 10rpx 30rpx;
			box-sizing: border-box;
			.address{
				width: 100%;
				height: 70rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 1rpx solid #eee;
			}
			.address .mode{
				font-size: 24rpx;
				color: #e50808;
			}
			.detail{
				width: 100%;
				height: 270rpx;
				padding-top: 10rpx;
				box-sizing: border-box;
			}
			.detail .row{
				width: 100%;
				height: 60rpx;
				line-height: 60rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
			}
			.row text:nth-child(2){
				text-align: right;
			}
			.time{
				width: 100%;
				height: 120rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-top: 1rpx solid #eee;
				button{
					width: 123rpx;
					height: 49rpx;
					background-color: #00a2f1;
					font-size: 24rpx;
					color: #fff;
					line-height: 49rpx;
					margin: 0;
				}
			}
		}
	}
</style>